﻿<%@ Page Title="ChiTietDonDatHang" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.Master"
    AutoEventWireup="true" CodeFile="ChiTietDonDatHang.aspx.cs" Inherits="NhaCungCap.Admin.ChiTietDonDatHang" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h3>
        Thông tin đặt hàng</h3>
    <asp:ListView ID="ListView2" runat="server">
        <LayoutTemplate>
            <table id="Table1" runat="server" style="margin-bottom: 30px;">
                <tr id="Tr1" runat="server">
                    <td id="Td1" runat="server">
                        <table id="itemPlaceholderContainer" runat="server" border="1">
                            <tr id="Tr2" runat="server" style="background-color: #111111; color: white;">
                                <th colspan="2">
                                    Thông tin đặt hàng
                                </th>
                            </tr>
                            <tr id="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <InsertItemTemplate>
            <span style="">IDUser:
                <asp:TextBox ID="IDUserTextBox" runat="server" Text='<%# Bind("IDUser") %>' />
                <br />
                ThoiDiemLapDDH:
                <asp:TextBox ID="ThoiDiemLapDDHTextBox" runat="server" Text='<%# Bind("ThoiDiemLapDDH") %>' />
                <br />
                TongTien:
                <asp:TextBox ID="TongTienTextBox" runat="server" Text='<%# Bind("TongTien") %>' />
                <br />
                SoDienThoaiNguoiNhan:
                <asp:TextBox ID="SoDienThoaiNguoiNhanTextBox" runat="server" Text='<%# Bind("SoDienThoaiNguoiNhan") %>' />
                <br />
                DiaChiGiaoHang:
                <asp:TextBox ID="DiaChiGiaoHangTextBox" runat="server" Text='<%# Bind("DiaChiGiaoHang") %>' />
                <br />
                EmailNguoiNhan:
                <asp:TextBox ID="EmailNguoiNhanTextBox" runat="server" Text='<%# Bind("EmailNguoiNhan") %>' />
                <br />
                TrangThai:
                <asp:TextBox ID="TrangThaiTextBox" runat="server" Text='<%# Bind("TrangThai") %>' />
                <br />
                code:
                <asp:TextBox ID="codeTextBox" runat="server" Text='<%# Bind("code") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                <br />
                <br />
            </span>
        </InsertItemTemplate>
        <SelectedItemTemplate>
            <span style="">IDUser:
                <asp:Label ID="IDUserLabel" runat="server" Text='<%# Eval("IDUser") %>' />
                <br />
                ThoiDiemLapDDH:
                <asp:Label ID="ThoiDiemLapDDHLabel" runat="server" Text='<%# Eval("ThoiDiemLapDDH") %>' />
                <br />
                TongTien:
                <asp:Label ID="TongTienLabel" runat="server" Text='<%# Eval("TongTien") %>' />
                <br />
                SoDienThoaiNguoiNhan:
                <asp:Label ID="SoDienThoaiNguoiNhanLabel" runat="server" Text='<%# Eval("SoDienThoaiNguoiNhan") %>' />
                <br />
                DiaChiGiaoHang:
                <asp:Label ID="DiaChiGiaoHangLabel" runat="server" Text='<%# Eval("DiaChiGiaoHang") %>' />
                <br />
                EmailNguoiNhan:
                <asp:Label ID="EmailNguoiNhanLabel" runat="server" Text='<%# Eval("EmailNguoiNhan") %>' />
                <br />
                TrangThai:
                <asp:Label ID="TrangThaiLabel" runat="server" Text='<%# Eval("TrangThai") %>' />
                <br />
                code:
                <asp:Label ID="codeLabel" runat="server" Text='<%# Eval("code") %>' />
                <br />
                <br />
            </span>
        </SelectedItemTemplate>
        <EmptyDataTemplate>
            <span>No data was returned.</span>
        </EmptyDataTemplate>
        <EditItemTemplate>
            <span style="">IDUser:
                <asp:TextBox ID="IDUserTextBox" runat="server" Text='<%# Bind("IDUser") %>' />
                <br />
                ThoiDiemLapDDH:
                <asp:TextBox ID="ThoiDiemLapDDHTextBox" runat="server" Text='<%# Bind("ThoiDiemLapDDH") %>' />
                <br />
                TongTien:
                <asp:TextBox ID="TongTienTextBox" runat="server" Text='<%# Bind("TongTien") %>' />
                <br />
                SoDienThoaiNguoiNhan:
                <asp:TextBox ID="SoDienThoaiNguoiNhanTextBox" runat="server" Text='<%# Bind("SoDienThoaiNguoiNhan") %>' />
                <br />
                DiaChiGiaoHang:
                <asp:TextBox ID="DiaChiGiaoHangTextBox" runat="server" Text='<%# Bind("DiaChiGiaoHang") %>' />
                <br />
                EmailNguoiNhan:
                <asp:TextBox ID="EmailNguoiNhanTextBox" runat="server" Text='<%# Bind("EmailNguoiNhan") %>' />
                <br />
                TrangThai:
                <asp:TextBox ID="TrangThaiTextBox" runat="server" Text='<%# Bind("TrangThai") %>' />
                <br />
                code:
                <asp:TextBox ID="codeTextBox" runat="server" Text='<%# Bind("code") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                <br />
                <br />
            </span>
        </EditItemTemplate>
        <ItemTemplate>
            <table class="table_dat_hang">
                <tr>
                    <td>
                        Code:
                        <asp:Label ID="codeLabel" runat="server" Text='<%# Eval("code") %>' />
                    </td>
                    <td>
                        Tên người dùng:
                        <asp:Label ID="IDUserLabel" runat="server" Text='<%# Eval("IDUser") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Thời điểm đặt hàng:
                        <asp:Label ID="ThoiDiemLapDDHLabel" runat="server" Text='<%# Eval("ThoiDiemLapDDH") %>' />
                    </td>
                    <td>
                        Tổng tiền:
                        <asp:Label ID="TongTienLabel" runat="server" Text='<%# format_tt(Eval("TongTien").ToString()) %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Số điện thoại người nhận:
                        <asp:Label ID="SoDienThoaiNguoiNhanLabel" runat="server" Text='<%# Eval("SoDienThoaiNguoiNhan") %>' />
                    </td>
                    <td>
                        Địa chỉ giao hàng:
                        <asp:Label ID="DiaChiGiaoHangLabel" runat="server" Text='<%# Eval("DiaChiGiaoHang") %>' />
                    </td>
                </tr>
                <tr>
                    <td>
                        Email người nhận:
                        <asp:Label ID="EmailNguoiNhanLabel" runat="server" Text='<%# Eval("EmailNguoiNhan") %>' />
                    </td>
                    <td>
                        Trạng thái:
                        <asp:Label ID="TrangThaiLabel" runat="server" Text='<%# format_text(Eval("TrangThai").ToString()) %>' />
                    </td>
                </tr>
                <tr>
            </table>
        </ItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringMembership %>"
        SelectCommand="SELECT [ID_aspUser], [ThoiDiemLapDDH], [TongTien], [SoDienThoaiNguoiNhan], [DiaChiGiaoHang], [EmailNguoiNhan], [TrangThai], [code] FROM [DonDatHang]">
    </asp:SqlDataSource>
    <h3>
        Chi tiết đơn đặt hàng</h3>
    <asp:ListView ID="ListView1" runat="server">
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table id="itemPlaceholderContainer" runat="server" border="1">
                            <tr runat="server" style="background-color: #111111; color: white;">
                                <th runat="server">
                                    Mã
                                </th>
                                <th runat="server">
                                    Tài liệu
                                </th>
                                <th runat="server">
                                    Số lượng
                                </th>
                                <th runat="server">
                                    Đơn giá
                                </th>
                            </tr>
                            <tr id="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <InsertItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                </td>
                <td>
                    <asp:TextBox ID="IDDonDatHangTextBox" runat="server" Text='<%# Bind("IDDonDatHang") %>' />
                </td>
                <td>
                    <asp:TextBox ID="IDTaiLieuTextBox" runat="server" Text='<%# Bind("IDTaiLieu") %>' />
                </td>
                <td>
                    <asp:TextBox ID="SoLuongTextBox" runat="server" Text='<%# Bind("SoLuong") %>' />
                </td>
                <td>
                    <asp:TextBox ID="DonGiaTextBox" runat="server" Text='<%# Bind("DonGia") %>' />
                </td>
            </tr>
        </InsertItemTemplate>
        <SelectedItemTemplate>
            <tr style="background-color: #E2DED6; font-weight: bold; color: #333333;">
                <td>
                    <asp:Label ID="IDDonDatHangLabel" runat="server" Text='<%# Eval("IDDonDatHang") %>' />
                </td>
                <td>
                    <asp:Label ID="IDTaiLieuLabel" runat="server" Text='<%# Eval("IDTaiLieu") %>' />
                </td>
                <td>
                    <asp:Label ID="SoLuongLabel" runat="server" Text='<%# Eval("SoLuong") %>' />
                </td>
                <td>
                    <asp:Label ID="DonGiaLabel" runat="server" Text='<%# Eval("DonGia") %>' />
                </td>
            </tr>
        </SelectedItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" style="background-color: #FFFFFF; border-collapse: collapse;
                border-color: #999999; border-style: none; border-width: 1px;">
                <tr>
                    <td>
                        No data was returned.
                    </td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <EditItemTemplate>
            <tr style="background-color: #999999;">
                <td>
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                </td>
                <td>
                    <asp:TextBox ID="IDDonDatHangTextBox" runat="server" Text='<%# Bind("IDDonDatHang") %>' />
                </td>
                <td>
                    <asp:TextBox ID="IDTaiLieuTextBox" runat="server" Text='<%# Bind("IDTaiLieu") %>' />
                </td>
                <td>
                    <asp:TextBox ID="SoLuongTextBox" runat="server" Text='<%# Bind("SoLuong") %>' />
                </td>
                <td>
                    <asp:TextBox ID="DonGiaTextBox" runat="server" Text='<%# Bind("DonGia") %>' />
                </td>
            </tr>
        </EditItemTemplate>
        <ItemTemplate>
            <tr style="background-color: #E0FFFF; color: #333333;">
                <td>
                    <asp:Label ID="IDDonDatHangLabel" runat="server" Text='<%# Eval("IDChiTietDDH") %>' />
                </td>
                <td>
                    <asp:Label ID="IDTaiLieuLabel" runat="server" Text='<%# Eval("IDTaiLieu") %>' />
                </td>
                <td>
                    <asp:Label ID="SoLuongLabel" runat="server" Text='<%# Eval("SoLuong") %>' />
                </td>
                <td>
                    <asp:Label ID="DonGiaLabel" runat="server" Text='<%# format_tt(Eval("DonGia").ToString()) %>' />
                </td>
            </tr>
        </ItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringMembership %>"
        SelectCommand="SELECT [IDChiTietDDH], ( select TenTL FROM [TaiLieu] where [TaiLieu].IDTaiLieu = [ChiTietDDH].IDTaiLieu ) as [IDTaiLieu], [SoLuong], [DonGia] FROM [ChiTietDDH] ">
    </asp:SqlDataSource>
    <div class="bonut_vc">
        <asp:Button ID="Button1" runat="server" Text="Quay Về" CssClass="button" PostBackUrl="~/Admin/DonDatHang.aspx" />
        <asp:Button ID="Button2" runat="server" Text="Vận chuyển" CssClass="button" OnClick="Button2_Click1" />
        <br />
    </div>
    <div id="van_chuyen" visible="false" runat="server">
        <table runat="server">
            <tr>
                <td>
                    <table id="Table2" runat="server" class="table_vc">
                        <tr runat="server" style="background-color: #111111; color: white;">
                            <th colspan="2">
                                Điền thông tin vào mẫu để đặt lệnh vận chuyển
                            </th>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label8" runat="server" Text="Web service:"></asp:Label>
                            </td>
                            <td>
                                <asp:DropDownList ID="DropDownList2" runat="server" AppendDataBoundItems="true" AutoPostBack="true"
                                    DataSourceID="SqlDataSource3" DataTextField="ten_ws" DataValueField="Newcolumn"
                                    Height="30px" OnSelectedIndexChanged="DropDownList2_SelectedIndexChanged" Width="200px">
                                    <asp:ListItem Text=" ----Chọn nhà vận chuyển----" Value="0" Selected="True"> </asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label2" runat="server" Text="Địa chỉ gửi:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="addr_from" runat="server" Visible="true"></asp:TextBox>

                                <asp:DropDownList ID="Prov_from" runat="server" Height="22px" Width="156px" Visible="true">
                                </asp:DropDownList>

                            </td>
                        </tr>

                        <tr>
                            <td>
                                <asp:Label ID="Label4" runat="server" Text="Địa chỉ nhận:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="addr_to" runat="server"></asp:TextBox>
                                 <asp:DropDownList ID="Prov_to" runat="server" Height="22px" Width="156px" Visible="true">
                                </asp:DropDownList>
                            </td>
                        </tr>
                   
                        <tr>
                            <td>
                                <asp:Label ID="Label6" runat="server" Text="Loại vận chuyển:"></asp:Label>
                            </td>
                            <td>
                                <asp:DropDownList ID="serv_type" runat="server" Height="22px" Width="156px" Visible="true">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label12" runat="server" Text="Tên sản phẩm:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="ten_san_pham" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label7" runat="server" Text="Số lượng:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="so_luong" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label9" runat="server" Text="Ngày giao:"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="Dated" runat="server"></asp:TextBox>(d/m/yy)
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label10" runat="server" Text="Thời gian:"></asp:Label>
                            </td>
                            <td>
                             
                                <asp:DropDownList ID="gio" runat="server" Visible="true">
                                </asp:DropDownList>(h)
                                <asp:DropDownList
                                    ID="phut" runat="server" Visible="true">
                                </asp:DropDownList>(m)
                            </td>
                        </tr>
                    
                        <tr>
                            <td>
                                <asp:Label ID="lb_tt" Visible="true" runat="server" Text="Tổng tiền: "></asp:Label>
                            </td>
                            <td>
                                <asp:Label ID="tong_tien" Visible="true" runat="server" Text=""></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="bonut">
                                <asp:Button ID="Button3" runat="server" Text="Tính tiền" Visible="true" OnClick="Button2_Click" CssClass="submit" />
                                <asp:Button CssClass="submit" ID="Button4" runat="server" Text="Đặt lệnh vận chuyển" 
                                    OnClick="DatLenhVanChuyen" Height="24px" />
                            </td>
                           
                        </tr>
                        <tr>
                         <td>
                                <asp:Label ID="Result" runat="server" Text="" Visible="false"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringMembership %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT [ten_ws], ([ma] + '???' +[link] + '***' + [service_name] + '^^^' + [user_name] + '$$$' +[pass] ) as Newcolumn FROM [Transport_WS]">
    </asp:SqlDataSource>
</asp:Content>
